home *** CD-ROM | disk | FTP | other *** search
- /* Fade Demo
- ** ---------
- ** There are three examples of fading in this program: Fade_To_White,
- ** Fade_To_Palette, and Fade_To_Black.
- **
- ** Press fire to see the end of the fade sequence.
- */
-
- MODULE 'games','games/games'
-
- PROC main()
- DEF screen:PTR TO gamescreen, palette:PTR TO INT, fadestate=0:LONG,
- loadpic:PTR TO picture
-
- palette := [ $0000,$0130,$0FCB,$0FA9,$0D88,$0965,$0644,$0211,
- $0400,$0444,$0FF0,$0432,$0CC0,$0150,$0501,$0880,
- $0261,$0271,$0382,$0492,$05A3,$05B4,$0677,$06C4,
- $0788,$09AA,$0BCC,$0801,$0901,$0A02,$0701,$0601
- ]:INT;
-
- screen := [ GSV1,0,
- 0,0,0,
- 0,
- 0,
- 0,
- 32,
- 320,256,320,256,
- 5,
- 0,0,
- 0,0,
- 0,
- LORES,
- INTERLEAVED,
- 0
- ]:gamescreen;
-
- loadpic := [ PCV1,0, -> Version header.
- 0, -> Destination.
- 320,256, -> Width, Height.
- 5, -> Amount of Planes.
- 32, -> Amount of colours.
- palette, -> Palette (remap).
- LORES, -> Screen mode.
- INTERLEAVED, -> Destination.
- 0 -> Parameters.
- ]:picture;
-
- IF gmsbase := OpenLibrary('games.library',0)
- SetUserPri()
- IF (Add_Screen(screen) = ERR_OK)
- loadpic.data := screen.memptr1;
- IF (LoadPic('GAMESLIB:data/IFF.Pic320',loadpic) = ERR_OK)
- Show_Screen(screen)
- Wait_Time(30)
-
- REPEAT
- Wait_VBL()
- Wait_OSVBL()
- fadestate := Col12_FadeToPalette(screen,fadestate,palette,0,32)
- UNTIL (fadestate = 0)
-
- Wait_LMB()
-
- REPEAT
- Wait_VBL()
- Wait_OSVBL()
- fadestate := Col12_FadeToWhite(screen,fadestate,0,32)
- UNTIL (fadestate = 0)
-
- Wait_Time(30)
-
- REPEAT
- Wait_OSVBL();
- fadestate := Col12_FadeToBlack(screen,fadestate);
- UNTIL (fadestate = 0);
-
- Wait_Time(50)
- ENDIF
- Delete_Screen(screen)
- ENDIF
- CloseLibrary(gmsbase)
- ENDIF
- ENDPROC
-
-